package action;

import object.PerCustInfoPage;
import org.openqa.selenium.WebDriver;
import org.springframework.stereotype.Service;
import utility.WaitElementUtil;

/**
 * Created by 000001159 on 2017/1/12.
 */
@Service
public class PerCustInfoActions extends WaitElementUtil {

    PerCustInfoPage perCustInfoPage;

    public void inputName(String name,WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custName).sendKeys(name);
    }

    public void selectCustType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custType).click();
        waitVisit(driver,perCustInfoPage.custTypeName).click();

    }

    public void selectCustChannelType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custChannelType).click();
        waitVisit(driver,perCustInfoPage.custChannelName).click();

    }

    public void selectCustNationType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custNationType).click();
        waitVisit(driver,perCustInfoPage.custNationName).click();

    }

    public void selectCustGenderType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custGenderType).click();
        waitVisit(driver,perCustInfoPage.custGenderName).click();

    }

    public void selectCustCertificateType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custCertificateType).click();
        waitVisit(driver,perCustInfoPage.custCertificateName).click();

    }

    public void selectCustEucationType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custEucationType).click();
        waitVisit(driver,perCustInfoPage.custEucationName).click();

    }

    public void selectCustDegreeType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custDegreeType).click();
        waitVisit(driver,perCustInfoPage.custDegreeName).click();

    }

    public void selectCustProfessionType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custProfessionType).click();
        waitVisit(driver,perCustInfoPage.custProfessionName).click();

    }

    public void selectCustMarriageType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custMarriageType).click();
        waitVisit(driver,perCustInfoPage.custMarriageName).click();
    }

    public void inputCustCertificateNum(String num,WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custCertificateNum).sendKeys(num);

    }

    public void inputCustPhoneNum(String num ,WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custPhoneNum).sendKeys(num);
    }

    public void clickButton(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custButton).click();
    }

    public void clickAlterButton(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.aButton).click();
    }

    public void clickTabBank(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.tabBank).click();
    }

    public void clickBankType(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custBankType).click();
        waitVisit(driver,perCustInfoPage.custBankTypeName).click();
    }

    public void clickBankName(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custBankid).click();
        waitVisit(driver,perCustInfoPage.custBankidName).click();
    }

    public void inputBankBranchName(String s ,WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custBankBranchName).sendKeys(s);
    }

    public void inputBankNum(String s,WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custBankNum).sendKeys(s);
    }

    public void inputBankPhone(String s,WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custBankPhone).sendKeys(s);
    }

    public void clickBankPhone(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custBankButton).click();
    }

    public void clickBankButton(WebDriver driver){
        perCustInfoPage=new PerCustInfoPage(driver);
        waitVisit(driver,perCustInfoPage.custBankButton).click();
    }


}
